package com.aiwei.tdjk.dto.response;

import java.util.Comparator;

/**
 * Created by yanfeng on 2018/1/22.
 */
public class ComparatorMatchHandBookResponse implements Comparator {

    public int compare(Object obj0, Object obj1) {
        MatchHandBookResponse user0=(MatchHandBookResponse)obj0;
        MatchHandBookResponse user1=(MatchHandBookResponse)obj1;

        //首先比较年龄，如果年龄相同，则比较名字

        int flag=user1.getFit().compareTo(user0.getFit());
        if(flag==0){
            return user1.getTotalFitCount()-(user0.getTotalFitCount());
        }else{
            return flag;
        }
    }

}